<template>
  <el-form-item label="切换时间">
        <el-input-number size="mini" v-model="tempValue" controls-position="right" :step="1" :min="2" />
  </el-form-item>
</template>

<script>
import { mapActions,  mapGetters } from 'vuex';
export default {
  name: 'attr-sxc-switchTime',
  props: {
    switchTime: [ Number, String ]
  },
  data() {
    return {
      tempValue: 2
    }
  },
  methods:{

  },
  mounted() {
    this.tempValue = (this.switchTime * 1) >= 2 ? this.switchTime * 1 : 2
  },
  computed: {
    ...mapGetters('programs', ['currScene']),
  },
  watch: {
    switchTime(v1){
      this.tempValue = (v1 * 1) >= 2 ? v1 * 1 : 2
    },
    url(val) {
      this.tempValue = val ? val : 2
    },
    tempValue() {
      let that = this;
      that.$emit('update:switchTime', that.tempValue)
    }
  }
}
</script>

<style lang="scss" scoped>
.attr-item-edit-wrapper .attr-item-edit-input.col-3 {
  margin-left: 0px;
}
</style>
